<%@page language="Java" contentType="text/html; UTF-8"
pageEncoding="UTF-8"%>
<%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="ssi.tools.Connector" %>

<h2>Usun Zwierzaka</h2>


<%
	Connection connection = new Connector().getConnection();
	Statement statement = connection.createStatement();
	ResultSet result = statement.executeQuery("SELECT id, name, breed FROM animals");
	int numberOfRows = Connector.getRowCount(result);
%>
<html:form action="deleteAnimal">
	<select name="id" id="id">
		<option value="0">Wybierz...</option>
		<%
				int i = 0;
				while (result.next()) {
		%>
		<option value="<%=result.getString("id")%>"><%=result.getString("name") + " "
							+ result.getString("breed")%></option>
		<%
			}
		%>
	</select>
	<input type="submit" class="submit" value="Usun" /><br>
			<font color="red"><html:errors property="info" /></font>
</html:form>